#pragma once

#include <vector>
#include <string>

typedef std::vector<const char*>    TStatusToMessage;

const TStatusToMessage& GetHttpStatusMessages();

struct THttpResponseTemplate {
public:
    static const char           KStatusLine[];
    static const unsigned int   KStatusLineLen;

    static const char           KServer[];
    static const unsigned int   KServerLen;

    //Content
    static const char           KContentLength[];
    static const unsigned int   KContentLengthLen;
    static const char           KContentType[];
    static const unsigned int   KContentTypeLen;

    static const char           KConnectionClose[];
    static const unsigned int   KConnectionCloseLen;
};

struct THttpRequest {
public:
    THttpRequest()
    : HttpVersion(NULL)
    , HttpVersionLen(0)
    , Method(NULL)
    , MethodLen(0)
    , Path(NULL)
    , PathLen(0)
    {}

    enum ESupportedMethods {
        GET =   0,
        HEAD,
        UNSUPPORTED
    };

    bool IsValid();
    ESupportedMethods GetMethod();

    const char*     HttpVersion;
    unsigned int    HttpVersionLen;
    const char*     Method;
    unsigned int    MethodLen;
    const char*     Path;
    unsigned int    PathLen;
};
